if Network:is_client() then
	return
end

local RCWeapon_NPCRaycastWeaponBase_fire_raycast = NPCRaycastWeaponBase._fire_raycast

function NPCRaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit)
	local unit = nil
	local mvec_from_pos = Vector3()
	local mvec_direction = Vector3()
	local crit = math.lerp(1, 100, math.random())
	if crit < 101 and user_unit and alive(user_unit) and target_unit and alive(target_unit) and user_unit:base() and user_unit:base()._tweak_table and user_unit:base()._tweak_table == "sniper" or crit == 1 and user_unit and alive(user_unit) and target_unit and alive(target_unit) and user_unit:base() and user_unit:base()._tweak_table and user_unit:base()._tweak_table == "phalanx_minion" then
		mvector3.set(mvec_from_pos, from_pos)
		mvector3.set(mvec_direction, direction)
		mvector3.multiply(mvec_direction, 100)
		mvector3.add(mvec_from_pos, mvec_direction)
		if not self._client_authoritative then
			unit = ProjectileBase.throw_projectile("rocket_frag", mvec_from_pos, direction)
		end
		return {}
	end
	return RCWeapon_NPCRaycastWeaponBase_fire_raycast(self, user_unit, from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul, target_unit)
end